Credit to Flying Ace, Twilkitri (and whoever worked with him on the parser, if anyone did) and ~Zeld~ (but mostly Flying Ace) for control code documentation.

Credit to Twilkitri for inspiring ~Zeld~ to figure out how the hell to hack text on his own. ~Zeld~ was jealous of those ingenious parsers.

Credit to ~Zeld~ for developing a sound way to dump the translated FE 6 game script so that the translators wouldn't have to hand it over.

Credit to the translators for translating the game so that an English script could be dumped in the first place. :3

Credit to ~Zeld~ for making the .tbl and .ips files that make text editing so much quicker, as well as eliminating data loss worries that sprang up during parsing.

Whee tutorial time

---FE 6, 7, and 8---

Get Translhextion. It is a kick ass hex editor. Srsly

I will refer to Translhextion as "T Hex" from here on, for personal convenience.

Type the text you want in the game into notepad. Type the commands you want to use as they appear on the right side of the command in the Control Codes.txt file:

For a new line, type "[NL]", for a double new line, type [2NL], etc.

Use the return key to separate things if you need to make your script more readable.

FE 7 Example:

[OpenFarFarLeft][LoadFace]<bh:33>[NL]
[MoveRight][NL]
[LoadFace]<bh:33>[NL]
Twirly[NL]
[ClearFace][NL]
[OpenRight][LoadFace]<bh:33>[NL]
[MoveLeft][NL]
Twirly[NL]

Use <bh:XX> for the hex of a portrait, as seen above. Florina's portrait value is 0x33, so to load her face you must use [LoadFace]<bh:33>

Remember to use a [NL] after most commands. When you've made enough scripts that don't FSOD the game, you'll figure out when to use an [NL] and when you don't need one. As a rule of thumb, however, always use an [NL] after a <bh:XX>. And of course, always use a <bh:XX> after a [LoadFace], or you'll bust the conversation.

You don't have to be typing a conversation, though. This will work with any text in the game...just remember not to use a [LoadFace] when typing up non-conversational text (e.g. the blue background narrative text in between chapters...the faces are loaded separately in that case).

Anyhow, get your script typed up in notepad or some other simple text editor.

When you're done, hit Ctrl+A to select it all and copy and paste it into an empty T-Hex file. Choose "insert" as the pasting method.

Using T-Hex, load our .tbl using the "Script->Open Thingy Table" command. Load the FE 7 and 8 table.

"What if I'm doing FE 6 text?"

Too bad. You need to use the FE 7 and 8 table first because Translhextion gets confused by the absurdity of using 2 bytes to represent a single byte. I can't say I blame it because what you'll end up doing for FE 6 text is actually making the hex around twice as big as the text you typed, and it should be the other way around. That's why it's called optimization. But lo, FE 6 text uses 2 bytes per character, and so the resulting hex will be more. Pitiful!

Make sure you have the .tbl loaded, and press Ctrl+A again to highlight all of the text/hex in T-Hex. Click "Script->Dump Script".

Here's the cool part. Click the radio to dump the script to a new window (as opposed to a file) and leave the other options alone and click "OK". It should dump all of the script (by default it dumps everything that you have selected, though you can specify exact pieces). In the window that pops up you will see your script crummily displayed. At the bottom of this window will be a box that is labeled "optimize script".

CLICK IT!

Then, click "Re-Insert" on the right side of the screen. It should prompt you to either cancel the re-insertion or to replace all the extra space you have left over with zeros.

Click OK to fill the extra space with zeros, and all those [Commands] should be converted to hex, significantly shortening the file AND correctly formatting the data. Now, go to the end of the file and select from the last zero all the way to the second zero in the file - that is, the zero just after the zero you will use to end the conversation (assuming it's a conversation, but in any case, the last byte of any block of text will always be 0x00).

Delete all of those extra zeros (press the delete key and tell it to cut the bytes, preferably without copying the cut out bytes to the clipboard).

Your script should now be reduced to nothing but the necessary hex for the conversation and the 0x0D0A's that result from pasting a text file that has line breaks in it.

This is a problem, and you must get rid of the line breaks in order to rectify the text. So, click "Search->Replace" after clicking the very first byte of the file. Type "<bh:0d><bh:0a>" or <wh:0a0d> ("wh" is the same as two "bh"'s, except the byte order is reversed. T Hex likes little endian I guess) in the top box and make sure the bottom box is completely empty. Click the "replace all following occurances" button to eliminate all those line breaks (and by line breaks I mean the ASCII line breaks, not the [NL] commands).

After all that you should have a proper hex dump of the text you want to insert into the game, unless you're doing FE 6 text. If you are, then skip past the next paragraph and come back to it after you reach the end of the FE 6 text tutorial thing.*

Save the text as a .dmp (I suppose you don't have to, but .dmp files and Visual Boy Advance get along) and place it in the ROM. Apply my Anti-Huffman patch (the FE 6 Anti Huffman.ips for FE 6, etc.), change a text pointer (figure out which one you're changing by searching for the text you want to change in the script dump and going to the first address that is displayed above the text you find; be wary of recurring text) to point to the new text, and set the uppermost bit of the pointer to flag the text as raw. Bam, text hack supreme

*Redirected from FE 6 text hacking:

At this point, load the table called "FE 6 Insertion Table" over the previous 7 and 8 table. Highlight all the text and choose to dump it again.

This time, uncheck the box labeled "separate byte format". Instead of clicking optimize and reinsert when you arrive at the dump screen, simply copy the text that appears in the screen. Close the dump window and open a new T Hex file (don't worry about saving). Paste the text you copied (use "Insert" as the pasting method again) into the text window of the hex editor and it should parse all those <bh:XX> and <wh:XXXX> codes as the proper hex.

After all that, load the FE 6 Table.tbl file and view the hex as FE 6 text. Look around for mistakes that may have occured.

I can almost guarantee that the hex for portrait values when using a "[LoadFace]" command will be screwed over because sometimes the portrait values are equivalent to an ASCII character that will be treated as text rather than a portrait value during the conversion from FE 7 and 8 text hex to FE 6 text hex. Manually correct this. Shouldn't be difficult since you should be doing each block of text separately. It's not like you're parsing an entire game script at once...

Now go back to that "*" you came from and read the paragraph on how to use my Anti-Huffman patch to change text without the parser.

Now all this looks long and complicated but it's actually very quick to do when you don't have to read through a tutorial.

And if you still happen to be doing better with the parser, well, be my guest. I'll just keep the pleasure of editing text fast and easy with no data loss to myself.